package com.recipedb.recipedb.repository;

import com.recipedb.recipedb.entity.UserMessage;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;

public interface UserMessageRepository extends JpaRepository<UserMessage, Long> {

    List<UserMessage> findByUserIdOrderByCreatedAtDesc(Long userId);

    List<UserMessage> findByUserIdAndReadFlagFalseOrderByCreatedAtDesc(Long userId);

    List<UserMessage> findByUserIdAndReadFlagFalse(Long userId);
}